import Vue from 'vue'
// 蓝牙信息
const store = {
	state: {
		writeUUID: '6A500002-B5A3-F393-E0A9-E50E24DCCA9E', // 蓝牙写入ID
		nottifyUUID: '6A500003-B5A3-F393-E0A9-E50E24DCCA9E', // 广播通知ID 
		mainService: '6A500001-B5A3-F393-E0A9-E50E24DCCA9E', // 蓝牙主服务ID
		bleState: false, // 蓝牙状态
		deviceId: '' // 蓝牙ID
	},
	getters: {
		
	},
	mutations: {
		// 设置蓝牙状态
		SET_BLE_STATE(state, status) {
			state.bleState = status
		},
		// 蓝牙错误提示
		BLE_ERR_TOAST(state, code) {
			const vue = new Vue()
			const errCode = vue.$t('bleConnecrErrCode').data
			uni.showToast({
				icon: 'none',
				title: errCode[code] || code
			})
		}
	},
}

export default store